package com.lightjet.macross.base.upms.service.impl;

import com.lightjet.macross.base.upms.domain.RoleInfo;
import com.lightjet.macross.base.upms.domain.SystemInfo;
import com.lightjet.macross.base.upms.repository.RoleInfoRepository;
import com.lightjet.macross.base.upms.service.RoleInfoService;
import com.lightjet.macross.common.core.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleInfoServiceImpl extends BaseServiceImpl<RoleInfo,Integer> implements RoleInfoService {


    /**
     * Description //根据ID获取角色对象
     * @return com.lightjet.macross.base.upms.domain.RoleInfo
     * CreateTime 2020/3/7 11:30
     * @author lijia
     * @Param id
     */
    @Override
    public RoleInfo FindDistinctById(Integer id) {
        return ((RoleInfoRepository)baseRepository).findDistinctById(id);
    }

    /**
     * Description //根据系统及父节点获取其下属的角色集合
     * @param systemInfo 应用系统对象
     * @return java.util.List<com.lightjet.macross.base.upms.domain.RoleInfo>
     * CreateTime 2020/3/10 13:59
     * @author lijia
     * @Param roleInfo 角色对象
     **/
    @Override
    public List<RoleInfo> FindAllByParentAndBelongsystem(RoleInfo roleInfo, SystemInfo systemInfo) {
        return ((RoleInfoRepository)baseRepository).findAllByParentAndBelongsystem(roleInfo,systemInfo);
    }
}
